After all preconfiguration, installation, and setting up of virtual
machines, everything is up and running normally. However, what you
really need to consider is what is normal. What is the regular performance and system utilization for your physical and virtual servers?
Logged
monitoring will help you to answer that question, measuring realistic
conditions and helping you to identify the needs of servers and hardware
upgrades, optimization, and tunings, by using trend analysis. That's an
example of what you can get using baselines. A baseline is the level of
system performance that you decide is acceptable. Normally, they are
decided before deployment, during the planning phases.
Using data collector sets
from Perfmon, you can get realistic and advanced trend information and
create baselines that can start and stop automatically, based on your
schedule.
This recipe will show you how to use Perfmon to create baselines for your physical and virtual machines.
Baselines
must track the server activities during a specific period of time. You
can create daily, weekly, monthly, or any other schedule you need.
Before you start, decide what you want to monitor, such as processor,
memory, disk, and network, and for how long it will be monitored.
The following steps will show you the default system data collector sets and how to create user-defined collector sets:
- To use the default data collector sets, launch the Start menu, type
perfmon.msc
, and press Enter. - In the Performance Monitor window, under Performance, expand Data Collector Sets and click on System, as shown in the following screenshot:
- There are two default data collector sets named System Diagnostics and System Performance. To start either of them, right-click on it and select Start.
- To see the results, expand Reports | System and select the report you want to open.
- To create a new data collector set, right-click on User Defined under Data Collector Sets, select Data Collector Set, and click on New.
- In the Create new Data Collector Set. window, type a name, select Create manually (Advanced), and click on Next.
- On the What type of data do you want to include? screen, select the data type you want to use and click on Next.
- In
the new window, select the computer from which you want to get the data
for remote monitoring, select the counters and instances you want to
add, and click on Add, as shown in the following screenshot. When finished, click on OK.
- Under Performance Counters, under Sample Interval and Units, put the number and units you want to use to record the selected counters.
- Check the selected counters and click on Finish.
- After creating the new collector set, right-click on it under User Defined and click on Properties to change its options.
- In
the properties window, you can add a schedule to run the baseline
automatically, create a stop condition (as shown with the example in the
following screenshot), or change other options by using the tabs General, Directory, Security, Schedule, Stop Condition, and Task.
- After running the data collector sets, to check the collected data, expand Reports | User Defined in the Performance Monitor window and open the folder for the collector set you created.
- The
report will be shown in the right-hand pane. Use the toolbar and the
counter list to view and change the results windows, as shown in the
following screenshot:
On
Windows Server, Perfmon is the only built-in tool that can be used for
logged monitoring. It comes with two system collector sets that can be
used to get advanced reports showing system diagnostics and system
performance.
Under User Defined, you can create your own collector sets, based on the application or hardware you want to monitor.
For
virtual environments, you can use only the host partition to analyze
all the performance trends, but in some exceptions, a monitoring method
within particular virtual machines is required.
Hyper-V has
specific counters that let you know everything that is happening in the
virtualization stack, virtual machines, and host resources. Some
counters also have instances that can be triggered to monitor something
more specific. For example, when using the LogicalDisk counter, you can select which disk (instance) you want to add.
Due
to the high number of counters, the following list shows only a small
selection of Hyper-V counters based on the subsystem that will be
monitored. They can be used in conjunction to monitor parent and child
partitions too.
Hyper-V general:
- \Hyper-V Hypervisor\*
- \Hyper-V Virtual Machine Health Summary \*
- Hyper-V VM Save, Snapshot, and Restore\*
Physical and virtual processor:
- \Processor(_Total)\*
- \Hyper-V Hypervisor Logical Processor(*)\*
- \Hyper-V Hypervisor Root Virtual Processor (*) \ *
- \Hyper-V Hypervisor Virtual Processor (*) \ *
- \SynchronizationNuma(*)\*
- \NUMA Node Memory(*)\*
- \Hyper-V VM Vid Numa Node(*)\*
Memory:
- \Hyper-V Hypervisor Partition(*)\*
- \Hyper-V Hypervisor Root Partition(*)\*
- \Hyper-V Dynamic Memory Balancer(*)\*
- \Hyper-V Dynamic Memory Integration Services(*)\*
- \Hyper-V Dynamic Memory VM(*)\*
- \Hyper-V VM Vid Partition(*)\*
- \Memory\Pages / Sec
- \Memory\Available Bytes
Disk:
- \Hyper-V Virtual IDE Controller (Emulated)(*)\*
- \Hyper-V Virtual Machine Bus\*
- \Hyper-V Virtual Storage Device(*)\*
- \Physical Disk(*)\Current Disk Queue Length
- \Physical Disk(*)\Disk Bytes / sec
- \Physical Disk(*)\Disk Transfers/sec
- \Logical Disk(*)\Avg. Disk sec/Read
- \Logical Disk(*)\Avg. Disk sec/Write
Network:
- \Network Interface(*)\*
- \Hyper-V Virtual Network Adapter(*)\*
- \Hyper-V Virtual Switch(*)\*
- \Hyper-V Virtual Switch Processor(*)\*
- \Hyper-V Virtual Switch Port(*)\*
- \IPv4\*
- \Hyper-V Legacy Network Adapter(*)\*
- \Per Processor Network Activity Cycles(*)\*
- \Per Processor Network Interface Card Activity(*)\*
- \TCPv4\*
There
is no standard for creating a baseline. Each environment is different
from the other. You will need to identify which resources need to be
monitored and then create your monitoring plan. The number of counters
being monitored and the duration are also very important. If you have a
data collector set with lots of counters that uses a small interval of
time, you might have performance, storage, and network issues. Make sure
the interval used is larger for longer monitoring windows. For
instance, to monitor a server for just one day, you can use a 10-minute
interval, and for one week of monitoring, a 1-hour interval.
Tip
In
case you don't have a plan and just want to run a baseline to track and
analyze your system growth, you can create four baselines by using the
counters from the previous lists: processor, memory, disk, and network.
Remember
that these counters are just the normal ones for each subsystem, but
you have many more options that can be used for advanced monitoring
scenarios.
Now, with logged monitoring in place, you can analyze,
investigate, and evaluate your existing environment, finding the normal
baseline and using it to track any anomaly easily. The baseline results
will also help you to identify when a tuning or an upgrade is necessary.